home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Information / Digests / CSMP Digest / volume 3 / csmp-digest-v3-060 / doubleCR.1 < prev   
Encoding:
Text File  |  1995-12-31  |  56.2 KB  |  1,634 lines

  1. C.S.M.P. Digest             Thu, 22 Sep 94       Volume 3 : Issue 60
  2.  
  3. Today's Topics:
  4.  
  5.         Books to learn assembly language on Mac?
  6.         FYI: Fun Bug with CustomGetFile
  7.         How to call 68K lib from PPC code?
  8.         PROBLEM: Serial Port Programming & PowerBooks
  9.         Using CLUTs to simulate page flipping?
  10.         Why is AppleScript type checking absent?
  11.         [Q] _PBCatSearch vs Recursive Indexed _PBGetCatInfo
  12.  
  13.  
  14.  
  15. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  16. (pottier@clipper.ens.fr).
  17.  
  18. The digest is a collection of article threads from the internet newsgroup
  19. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  20. regularly and want an archive of the discussions.  If you don't know what a
  21. newsgroup is, you probably don't have access to it.  Ask your systems
  22. administrator(s) for details.  If you don't have access to news, you may
  23. still be able to post messages to the group by using a mail server like
  24. anon.penet.fi (mail help@anon.penet.fi for more information).
  25.  
  26. Each issue of the digest contains one or more sets of articles (called
  27. threads), with each set corresponding to a 'discussion' of a particular
  28. subject.  The articles are not edited; all articles included in this digest
  29. are in their original posted form (as received by our news server at
  30. nef.ens.fr).  Article threads are not added to the digest until the last
  31. article added to the thread is at least two weeks old (this is to ensure that
  32. the thread is dead before adding it to the digest).  Article threads that
  33. consist of only one message are generally not included in the digest.
  34.  
  35. The digest is officially distributed by two means, by email and ftp.
  36.  
  37. If you want to receive the digest by mail, send email to listserv@ens.fr
  38. with no subject and one of the following commands as body:
  39.     help                        Sends you a summary of commands
  40.     subscribe csmp-digest Your Name    Adds you to the mailing list
  41.     signoff csmp-digest            Removes you from the list
  42. Once you have subscribed, you will automatically receive each new
  43. issue as it is created.
  44.  
  45. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  46. Questions related to the ftp site should be directed to
  47. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  48. digest are available there.
  49.  
  50. Also, the digests are available to WAIS users.  To search back issues
  51. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  52. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  53.  
  54.  
  55. -------------------------------------------------------
  56.  
  57. >From gmei@hoh.mbl.edu (Guang Mei)
  58. Subject: Books to learn assembly language on Mac?
  59. Date: Thu, 1 Sep 1994 01:23:43 GMT
  60. Organization: Marine Biological Laboratory
  61.  
  62. Hi:
  63.  
  64. I need to learn assembly language on Mac and I cann't find any book(s) to
  65. start with. Could any one recommend any good book(s) to read? I have no
  66. assembly language programming experience before so the book should be for
  67. beginners.
  68.  
  69. Please post your answer here or e-mail your response to  gmei@hoh.mbl.edu
  70.  
  71. Thanks.
  72.  
  73. -- 
  74. - -----------
  75. Guang Mei   gmei@hoh.mbl.edu     Tel:(508)548-3705 ext 374
  76. Program of Architectural Dynamics in Living Cells
  77. Marine Biological Laboratory, Woods Hole, MA 02543
  78.  
  79. +++++++++++++++++++++++++++
  80.  
  81. >From kenlong@netcom.com (Ken Long)
  82. Date: Fri, 2 Sep 1994 00:27:35 GMT
  83. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  84.  
  85. Several options:
  86.  
  87. First, call your closest Motorola representative and have him send you a 
  88. catalog of their publications.
  89.  
  90. Then, check your local phone book - there's probably an ad for Ophamp 
  91. Technical Books in it, listing their 800 number.  Call and get their free 
  92. catalog.  You can then choose some appropriate books.  If their number 
  93. and ad are not there, call 1-800-555-1212, and get it from Information - 
  94. they are in Los Angeles.
  95.  
  96. Next, some books you may already have may have brief assembler info on 
  97. them (to read while waiting for a real book).  The MacsBug Reference and 
  98. Debugging Guide has 35 pages of assembler primer, and may also recommend 
  99. books.  Scott Knaster's "blue book" has some info on it.
  100.  
  101. Inside Mac has "Assembly Language notes" throughout.
  102.  
  103. Get an assembler programming environment and some example source and 
  104. start working with it.  Then when you get some books you can become more 
  105. adept at it.  You'd have to get an envronment anyway, regardless of 
  106. whether you got a book, if you want to program in assembler, so get that 
  107. part over with.  I don't know what's available for PPC's, but there are a 
  108. few 68k ones out there.  It may be too early to get into PPC assmbler 
  109. with ease.  Likely there are not many books on it, except from Motorola.
  110.  
  111. Does that help?
  112.  
  113. -Ken-
  114.  
  115. +++++++++++++++++++++++++++
  116.  
  117. >From khatt@shell.portal.com (Judy Ann Kettenhofen)
  118. Date: 3 Sep 1994 01:04:28 GMT
  119. Organization: Portal Communications Company -- 408/973-9111 (voice) 408/973-8091 (data)
  120.  
  121. Guang Mei (gmei@hoh.mbl.edu) wrote:
  122. : Hi:
  123.  
  124. : I need to learn assembly language on Mac and I cann't find any book(s) to
  125.  
  126. About 4-5 years ago I considered co-writing a book on 680x0 Asm.
  127. I was informed that I'd have a hard time finding a publisher, because
  128. asm books just weren't that much in demand.  A number of asm books
  129. I own currently are out of print (these are 680x0), so it's difficult
  130. to recommend a book that you will be able to find.
  131.  
  132. What are you trying to accomplish?  Are you attempting to write
  133. a complete program in asm or do you just need to write a little
  134. piece?
  135.  
  136. So....your learning tasks can be chunked like this:
  137.  
  138. 1. Understanding, generally, about machine language, memory
  139. addressing and so forth.
  140. 1.5 Become familiar with the major types of addressing modes
  141. and cpu models (i.e., 680x0 uses a set of general purpose
  142. registers; 80x86 has registers which must be used for specific
  143. purposes.)
  144.  
  145. 2. Become familiar with 680x0 instruction set & addressing modes.
  146. Your task will be made immeasurably simpler if you start with
  147. just the 68000 stuff.  With the advent of the 68020, Motorola
  148. added several new addressing modes which have a variety of
  149. permutations, such that the number of permutations is greater
  150. than the number of 68000 addressing modes.
  151.  
  152. 3. Learning specifically what it means to program in asm on
  153. the Mac.  This means becoming familiar with the Macintosh
  154. runtime model; e.g., jump tables, a5 offsets, loading segments,
  155. etc.  The MPW Assembler, for instance, makes certain assumptions
  156. which make it somewhat easier to program in asm on the Mac by
  157. in essence hiding information from you, especially when it comes
  158. to a5 offsets.
  159.  
  160. 4. If you use the MPW Asm, there are possibly other idiosyn-
  161. crasies with which you will want to become familiar. Most of
  162. these can be found by looking at the various directives.  IN
  163. particular, the MPW Asm will optimize your asm instructions to
  164. equivalent faster instructions unless you explicitly tell it
  165. not to.
  166.  
  167. Good Luck,
  168.  
  169. --Judy
  170.  
  171. PS Anyone use the "OPT SYNON" directive in the MPW Asm that was
  172. put in in MPW 3.3?
  173.  
  174. --former MPW Asm hack.
  175.  
  176. : start with. Could any one recommend any good book(s) to read? I have no
  177. : assembly language programming experience before so the book should be for
  178. : beginners.
  179.  
  180. : Please post your answer here or e-mail your response to  gmei@hoh.mbl.edu
  181.  
  182. : Thanks.
  183.  
  184. : -- 
  185. : -------------
  186. : Guang Mei   gmei@hoh.mbl.edu     Tel:(508)548-3705 ext 374
  187. : Program of Architectural Dynamics in Living Cells
  188. : Marine Biological Laboratory, Woods Hole, MA 02543
  189.  
  190. +++++++++++++++++++++++++++
  191.  
  192. >From bouldin@enh.nist.gov (Charles Bouldin)
  193. Date: 4 Sep 1994 13:19:13 GMT
  194. Organization: NIST
  195.  
  196. In article <kenlongCvH7xz.yv@netcom.com>, kenlong@netcom.com (Ken Long) wrote:
  197.  
  198. > Several options:
  199. > First, call your closest Motorola representative and have him send you a 
  200. > catalog of their publications.
  201.  
  202. Also, very old by now, but "The complete book of Macintosh assembly language"
  203. by Dan Weston is quite complete. Probably out of print, but you might find
  204. an old copy somewhere. ISBN # 0-673-18379-3 from Scott, Foresman and Co.
  205.  
  206. +++++++++++++++++++++++++++
  207.  
  208. >From khatt@shell.portal.com (Judy Ann Kettenhofen)
  209. Date: 4 Sep 1994 21:33:59 GMT
  210. Organization: Portal Communications Company -- 408/973-9111 (voice) 408/973-8091 (data)
  211.  
  212. Charles Bouldin (bouldin@enh.nist.gov) wrote:
  213. : In article <kenlongCvH7xz.yv@netcom.com>, kenlong@netcom.com (Ken Long) wrote:
  214.  
  215. : > Several options:
  216. : > 
  217. : > First, call your closest Motorola representative and have him send you a 
  218. : > catalog of their publications.
  219. : > 
  220.  
  221. : Also, very old by now, but "The complete book of Macintosh assembly language"
  222. : by Dan Weston is quite complete. Probably out of print, but you might find
  223. : an old copy somewhere. ISBN # 0-673-18379-3 from Scott, Foresman and Co.
  224.  
  225. When Dan's book came out, it was definitely a great book.
  226. However, there have been enough changes in programming the Mac
  227. using his examples can now lead to frustration.  If it weren't
  228. for that, I would recommend his book enthusiastically and without
  229. hesitation. Incidentally, he also wrote a vol II of that book.
  230.  
  231. +++++++++++++++++++++++++++
  232.  
  233. >From wdh@fresh.com (Bill Hofmann)
  234. Date: Wed, 7 Sep 1994 15:37:36 GMT
  235. Organization: Fresh Software
  236.  
  237.  
  238. Personally, I'd do these things:
  239. 1. Buy a 68000 manual (note I said 68000, not 68020 or 68030 or 68040).
  240.    Why? 68000 assembler is fairly simple, it gets hairier and hairier as 
  241.    you go on.  
  242. 2. Buy a PowerPC manual (after all, it's a Mac).  
  243. 3. Buy any CS textbook in assembler programming that looks relatively practical
  244. 4. Work through it.
  245. 5. Forget it all and use C or C++: it's much more portable, easier to learn,
  246.    quicker to develop,etc.
  247. 6. When, after developing what you've developed, if there are sections that
  248.    *really* need assembler (as opposed to a better algorithm), then you can
  249.    code those sections in assembler.
  250.  
  251. I've done more than my share of assembler, and personally, I'd just as soon
  252. beat my head against a brick wall.
  253. -- 
  254. Bill Hofmann                                   wdh@fresh.com
  255. Fresh Software and Instructional Design        voice: +1 510 524 0852
  256. 1640 San Pablo Ave #C Berkeley CA 94702 USA    fax:   +1 510 524 0853
  257.  
  258. +++++++++++++++++++++++++++
  259.  
  260. >From patc@teleport.com (Pat Caudill)
  261. Date: Thu, 8 Sep 94 03:57:21 GMT
  262. Organization: Teleport - Portland's Public Access (503) 220-1016
  263.  
  264.  
  265. You might ask at Powell's Bookstore (Technical books). They have a fairly
  266. large technical section (it's got it's own building). Their catalog is on
  267. line on the net. Send email to "ping@technicalal.powells.portland.or.us" and
  268. you will get accessing information. I dont work for them, just one of the
  269. browsers there.
  270.  
  271. Pat Caudill
  272.  
  273. ---------------------------
  274.  
  275. >From sped@lfso.ifa.hawaii.edu (Byron Han)
  276. Subject: FYI: Fun Bug with CustomGetFile
  277. Date: Tue, 6 Sep 1994 20:52:29 GMT
  278. Organization: Institute for Astronomy, Hawaii
  279.  
  280. If you write a custom hook proc so that you can select a folder or an
  281. alias (like ResEdit does) and you try to select an alias on the desktop,
  282. standard file will munge your vRefNum/dirID returned in the sfFile
  283. filsspec field...
  284.  
  285. Try selecting an alias on the desktop with ResEdit and you will see what
  286. I mean.  Also writing a snippet of code to reproduce is trivial as well.
  287.  
  288. Solution is safe off the sfFile structure when sfOpenAlias is received
  289. in your hookProc (and you transmogrify the item to sfOpenItem) and to
  290. restore the sfFile structure at lastCall time...
  291.  
  292.  
  293.  
  294. +++++++++++++++++++++++++++
  295.  
  296. >From dazuma@cco.caltech.edu (Daniel Azuma)
  297. Date: Wed, 07 Sep 1994 08:08:14 -0700
  298. Organization: California Institute of Technology
  299.  
  300. sped@lfso.ifa.hawaii.edu (Byron Han) wrote:
  301.  
  302. > If you write a custom hook proc so that you can select a folder or an
  303. > alias (like ResEdit does) and you try to select an alias on the desktop,
  304. > standard file will munge your vRefNum/dirID returned in the sfFile
  305. > filsspec field...
  306.  
  307. Yup, that one's been around for a while-- I first ran into it several
  308. years ago, soon after System 7 came out. It happens only if you try to
  309. select an ALIAS on the DESKTOP of a NON-STARTUP volume. (Selecting an
  310. alias on the desktop of the startup volume works fine.)
  311.  
  312. What's going on is, the vRefNum/dirID ALWAYS specifies the desktop folder
  313. on the startup volume in this case. To see this happen, create two aliases
  314. with the same name on the desktop, one on the startup volume, and one on
  315. another volume. Now try to use a program that supports opening aliases
  316. (like ResEdit or FileTyper) to open the alias on the non-startup volume.
  317. It will open the startup-volume alias instead.
  318.  
  319. One would think Apple could have fixed this by now. Geez.
  320.  
  321. Dan
  322.  
  323. - ----------------------------------------------------------------
  324.   Daniel Azuma            | "Rejoice in the Lord always; again I
  325.   Caltech                 |  will say, Rejoice..."
  326.   dazuma@cco.caltech.edu  |              --Philippians 4:4
  327. - ----------------------------------------------------------------
  328.  
  329. ---------------------------
  330.  
  331. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  332. Subject: How to call 68K lib from PPC code?
  333. Date: Mon, 5 Sep 94 23:22:46 BST
  334. Organization: Network Analysis Ltd
  335.  
  336. I'm working on a a port of a largish appl to native PPC. The 68K
  337. version calls a third party 68K lib to which we do not have the
  338. sources. How can we call this 68K lib from native PPC code? I've read
  339. chp 2 of "Inside Mac: PPC System Software" and I understand how to
  340. create a UPP and call it, but how do I get the 68K code into memory?
  341. The PPC linker won't slurp it in, of course.
  342.  
  343. The only thing I can think of is to make a 68K code resource, which
  344. links with the 68K lib, and provide some glue that creates UPPs on
  345. the PPC and calls the lib funcs directly on the 68K. Is there a
  346. better way? Or am I horribly confused, and there's a really easy way
  347. to do this that is so obvious it isn't worth mentioning in Inside Mac
  348. (say "yes", please...).
  349.  
  350. Sak Wathanasin
  351. Network Analysis Limited
  352. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  353.  
  354. Internet: sw@network-analysis-ltd.co.uk 
  355. uucp:     ...!uknet!nan!sw                       AppleLink: NAN.LTD
  356. Phone: (+44) 203 419996 Mobile:(+44) 850 587411  Fax: (+44) 203 690690
  357.  
  358. +++++++++++++++++++++++++++
  359.  
  360. >From h+@nada.kth.se (Jon W{tte)
  361. Date: Tue, 06 Sep 1994 11:59:45 +0200
  362. Organization: Royal Institute of Something or other
  363.  
  364. In article <100338.92m668@Ph.network-analysis-ltd.co.uk>,
  365. sw@network-analysis-ltd.co.uk (Sak Wathanasin) wrote:
  366.  
  367. >I'm working on a a port of a largish appl to native PPC. The 68K
  368. >version calls a third party 68K lib to which we do not have the
  369. >sources. How can we call this 68K lib from native PPC code? I've read
  370. >chp 2 of "Inside Mac: PPC System Software" and I understand how to
  371. >create a UPP and call it, but how do I get the 68K code into memory?
  372. >The PPC linker won't slurp it in, of course.
  373.  
  374. You have to build a standalone code resource out of the 68k 
  375. library. If the 68k library doesn't come in a standalone 
  376. version, you're hosed.
  377.  
  378. If the library is "Word Solutions Engine" by DataPak, they've 
  379. done the UPP part already, and are willing to sell it to you 
  380. for $400. Could be cheaper than your time to do the same, could 
  381. be more expensive, depending on how good (and expensive :-) you 
  382. are.
  383.  
  384. Cheers,
  385.  
  386.                 / h+
  387.  
  388.  
  389. --
  390.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  391.  
  392.   "Have a bearable day."
  393.  
  394.  
  395. +++++++++++++++++++++++++++
  396.  
  397. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  398. Date: Wed, 7 Sep 94 13:15:23 BST
  399. Organization: Network Analysis Ltd
  400.  
  401.  
  402. In article <9668AA920A31.4F78@klkmac010.nada.kth.se> 
  403. (comp.sys.mac.programmer), h+@nada.kth.se (Jon W{tte) writes:
  404.  
  405. > In article <100338.92m668@Ph.network-analysis-ltd.co.uk>,
  406. > sw@network-analysis-ltd.co.uk (Sak Wathanasin) wrote:
  407. > >I'm working on a a port of a largish appl to native PPC. The 68K
  408. > >version calls a third party 68K lib to which we do not have the
  409. > >sources. How can we call this 68K lib from native PPC code?....
  410. > You have to build a standalone code resource out of the 68k 
  411. > library. If the 68k library doesn't come in a standalone 
  412. > version, you're hosed.
  413.  
  414. Not sure what you mean by a "standalone version" - it's just an MPW
  415. ".o" file. I have had a private response from someone at Apple who
  416. confirmed that making a code resource out of the lib is indeed the
  417. way to go about it.
  418.  
  419. > If the library is "Word Solutions Engine" by DataPak, 
  420.  
  421. It isn't, worse luck.
  422.  
  423. > they've 
  424. > done the UPP part already, and are willing to sell it to you 
  425. > for $400. Could be cheaper than your time to do the same, could 
  426. > be more expensive, depending on how good (and expensive :-) you 
  427. > are.
  428.  
  429. I charge a bit more than $400 (:-)....
  430.  
  431. Many thanks to everyone who responded.
  432.  
  433. Sak Wathanasin
  434. Network Analysis Limited
  435. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  436.  
  437. Internet: sw@network-analysis-ltd.co.uk 
  438. uucp:     ...!uknet!nan!sw                       AppleLink: NAN.LTD
  439. Phone: (+44) 203 419996 Mobile:(+44) 850 587411  Fax: (+44) 203 690690
  440.  
  441. +++++++++++++++++++++++++++
  442.  
  443. >From ekstrom@aggroup.com (Harold Ekstrom)
  444. Date: Wed, 07 Sep 1994 18:36:52 -0800
  445. Organization: Ag Group
  446.  
  447. In article <9668AA920A31.4F78@klkmac010.nada.kth.se>, h+@nada.kth.se (Jon
  448. W{tte) wrote:
  449.  
  450. > In article <100338.92m668@Ph.network-analysis-ltd.co.uk>,
  451. > sw@network-analysis-ltd.co.uk (Sak Wathanasin) wrote:
  452. > >I'm working on a a port of a largish appl to native PPC. The 68K
  453. > >version calls a third party 68K lib to which we do not have the
  454. > >sources. How can we call this 68K lib from native PPC code? I've read
  455. > >chp 2 of "Inside Mac: PPC System Software" and I understand how to
  456. > >create a UPP and call it, but how do I get the 68K code into memory?
  457. > >The PPC linker won't slurp it in, of course.
  458. > You have to build a standalone code resource out of the 68k 
  459. > library. If the 68k library doesn't come in a standalone 
  460. > version, you're hosed.
  461.  
  462. That's right. There was a recent MacTech article about how to do this,
  463. but I can't recall exactly what month it was. 
  464.  
  465. > If the library is "Word Solutions Engine" by DataPak, they've 
  466. > done the UPP part already, and are willing to sell it to you 
  467. > for $400. Could be cheaper than your time to do the same, could 
  468. > be more expensive, depending on how good (and expensive :-) you 
  469. > are.
  470. > Cheers,
  471. >                                 / h+
  472. > --
  473. >   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  474.  
  475.  
  476. >   "Have a bearable day."
  477. - ------------------------------------------------------------
  478. Harold Ekstrom
  479. ekstrom@aggroup.com
  480. ag group, inc.
  481. 2540 camino diablo, suite 200
  482. walnut creek, ca 94596
  483. 510-937-7900 voice
  484. 510-937-2479 fax
  485. 510-937-6704 ara
  486. ftp.aggroup.com anonymous ftp
  487.  
  488.  
  489. +++++++++++++++++++++++++++
  490.  
  491. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  492. Date: Thu, 8 Sep 1994 17:05:47 GMT
  493. Organization: The World Public Access UNIX, Brookline, MA
  494.  
  495. sw@network-analysis-ltd.co.uk (Sak Wathanasin) writes:
  496.  
  497.  
  498. >In article <9668AA920A31.4F78@klkmac010.nada.kth.se> 
  499. >(comp.sys.mac.programmer), h+@nada.kth.se (Jon W{tte) writes:
  500.  
  501. >> In article <100338.92m668@Ph.network-analysis-ltd.co.uk>,
  502. >> sw@network-analysis-ltd.co.uk (Sak Wathanasin) wrote:
  503. >> 
  504. >> >I'm working on a a port of a largish appl to native PPC. The 68K
  505. >> >version calls a third party 68K lib to which we do not have the
  506. >> >sources. How can we call this 68K lib from native PPC code?....
  507. >> 
  508. >> You have to build a standalone code resource out of the 68k 
  509. >> library. If the 68k library doesn't come in a standalone 
  510. >> version, you're hosed.
  511.  
  512. >Not sure what you mean by a "standalone version" - it's just an MPW
  513. >".o" file. I have had a private response from someone at Apple who
  514. >confirmed that making a code resource out of the lib is indeed the
  515. >way to go about it.
  516.  
  517. It has to be *linkable* into a code resource. In this case this means
  518. that you have to be able to build a dispatcher for each of the calls
  519. in the library. It also cannot use any global space (either *variables*
  520. or *constants*) unless you want to jump through hoops to create an A5
  521. world for the library to store its globals and constants in. Check
  522. out the tech note called "globals in standalone code" for more info.
  523.  
  524. -Ivan
  525. - -
  526. Ivan Cavero Belaunde (ivanski@world.std.com)
  527. Avid VideoShop Project Lead
  528. Avid Technology, Inc.
  529.  
  530. ---------------------------
  531.  
  532. >From mrichter@ifi.unizh.ch (Mathias W. Richter)
  533. Subject: PROBLEM: Serial Port Programming & PowerBooks
  534. Date: Tue, 30 Aug 1994 13:57:39 GMT
  535. Organization: Dept. of Computer Science, University of Zurich
  536.  
  537. I have a problem with an application that reads/writes data
  538. from/to an external unit (bicycle computer that collects 
  539. data) via the serial ports of the Mac.
  540.  
  541. The application runs fine on all Macs except for the PowerBooks.
  542. On PowerBooks, during
  543.  
  544.                                         error:=FSWrite(currentOut, count, Ptr(outBuffer));
  545.                                         {* outBuffer: ARRAY [1..7] OF BYTE; *}
  546.  
  547. the serial driver goes into an infinite loop somewhere in its code. 
  548. In MacsBug it looks like this:
  549.  
  550.                     _vSyncWait    MOVE.W        $0010(A0),D0
  551.                                                             BGT.S             _vSyncWait
  552.  
  553. D0 stays $01 forever...
  554.     
  555. This only happens, when I use "external modem" in the portable control 
  556. panel (which I must when using the unit to communicate with) or when
  557. I use the printer port with the "internal modem" set (which doesn´t
  558. make sense for my application, but I tried it anyway).
  559.  
  560. I am opening the serial driver with the "OpenDriver" routines and I stick
  561. to the tool box calls of the Driver Mgr. and the Serial Mgr.
  562.  
  563. On my old Macintosh Portable  (as on all other Macs incl. PowerMac) it
  564. runs just fine.
  565. The error occurs no matter which fax/etc. software is or is not 
  566. installed and it occurs independently of the make of the installed modem.
  567.  
  568. PLEASE HELP!
  569.  
  570. Mathias.
  571. - ---------------------------
  572. Dept. of CS
  573. University of Zurich
  574. Switzerland
  575. email: mrichter@ifi.unizh.ch
  576. - ---------------------------
  577.  
  578. +++++++++++++++++++++++++++
  579.  
  580. >From mxmora@unix.sri.com (Matt Mora)
  581. Date: 30 Aug 1994 08:07:58 -0700
  582. Organization: SRI International, Menlo Park, CA
  583.  
  584. In article <mrichter-300894155324@ifimac06.ifi.unizh.ch> mrichter@ifi.unizh.ch (Mathias W. Richter) writes:
  585. >I have a problem with an application that reads/writes data
  586. >from/to an external unit (bicycle computer that collects 
  587. >data) via the serial ports of the Mac.
  588.  
  589. You forgot to set the handshake.
  590.  
  591. OSErr:=SerHShake(refNum_integer,flags_SerShk);
  592.  
  593.  
  594.  
  595. Xavier
  596.  
  597. P.S. I know because I made the same mistake. :-)
  598.  
  599.  
  600.  
  601.  
  602. -- 
  603. ___________________________________________________________
  604. Matthew Xavier Mora                       Matt_Mora@sri.com
  605. SRI International                       mxmora@unix.sri.com
  606. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  607.  
  608. +++++++++++++++++++++++++++
  609.  
  610. >From h+@nada.kth.se (Jon W{tte)
  611. Date: Tue, 30 Aug 1994 22:29:16 +0200
  612. Organization: Royal Institute of Something or other
  613.  
  614. In article <mrichter-300894155324@ifimac06.ifi.unizh.ch>,
  615. mrichter@ifi.unizh.ch (Mathias W. Richter) wrote:
  616.  
  617. >data) via the serial ports of the Mac.
  618. >
  619. >The application runs fine on all Macs except for the PowerBooks.
  620.  
  621. This, if anything, SHOULD go into the FAQ. Any volounteers for 
  622. a Q&A on this?
  623.  
  624. The PowerBooks serial drivers default to handshaking ON - you 
  625. have to call SerHShk to set handshaking to what you need.
  626.  
  627. However, calling FSRead/FSWrite on the serial ports is bad 
  628. style; using asynchronous PBReads and PBWrites are better, and 
  629. doing that while also using the Threads Manager takes you to 
  630. the upper half of the coolness ladder.
  631.  
  632. Oh, and _vSyncWait is where all drivers go to die, temporarily, 
  633. until the synchronous call they wait for completes and sets the 
  634. result code of the parameter block.
  635.  
  636. Cheers,
  637.  
  638.                     / h+
  639.  
  640.  
  641. --
  642.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  643.  
  644.   Reality exists only in your imagination.
  645.  
  646.  
  647. +++++++++++++++++++++++++++
  648.  
  649. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  650. Date: Wed, 31 Aug 1994 23:18:04 +1200 (NZST)
  651. Organization: (none)
  652.  
  653. mrichter@ifi.unizh.ch (Mathias W. Richter) writes:
  654. > I have a problem with an application that reads/writes data
  655. > from/to an external unit (bicycle computer that collects 
  656. > data) via the serial ports of the Mac.
  657.  
  658. This is the standard PowerBook Serial Port Lockup FAQ.
  659.  
  660. You need to call SerHShake to turn hardware handshaking off if you
  661. don't want to use hardware handshaking.
  662.  
  663. Hardware handshaking is turned on by default when you reset the serial
  664. ports, but it just happens that on desktop Macs you can usually get away
  665. with leaving the handshaking pins unconnected.  Not so on portables.
  666.  
  667. -- Bruce
  668.  
  669. +++++++++++++++++++++++++++
  670.  
  671. >From arose@ATHENA.MIT.EDU (Alex Rosen)
  672. Date: 7 Sep 1994 17:03:14 GMT
  673. Organization: Massachusetts Institute of Technology
  674.  
  675. Here's the code I use now.  I'm certainly not a Serial Driver
  676. expert, but it works for me.  Note taht all I'm sending is a dial string
  677. ("ATDT" etc.), so I'm not worrying about flow control or async
  678. routines.
  679.  
  680. --Alex
  681.  
  682. OpenDriver("\p.AOut", &outDriver);
  683. OpenDriver("\p.AIn", &inDriver); 
  684.  
  685.     // Turn off hardware handshaking.      
  686. SerShk    shake;
  687. memset( &shake, 0, sizeof(shake) );
  688. SerHShake( outDriver, &shake );
  689. SerHShake( inDriver, &shake );
  690.         
  691.     // set baud rate and stuff
  692. SerReset(outDriver, baud300 | stop10 | noParity | data8);
  693. SerReset(inDriver, baud300 | stop10 | noParity | data8);
  694.         
  695.     // send string
  696. long count = strlen(toModemBuf);
  697. FSWrite(outDriver, &count, toModemBuf);
  698.  
  699.  
  700.  
  701. ---------------------------
  702.  
  703. >From seanmcd@ac.dal.ca
  704. Subject: Using CLUTs to simulate page flipping?
  705. Date: 1 Sep 94 21:15:11 -0300
  706. Organization: Dalhousie University, Halifax, Nova Scotia, Canada
  707.  
  708. Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  709. would involve using 16 colours in a 256 colour palette. The top and bottom
  710. nybbles of the byte would hold the values for "page 1" and "page 2". Games
  711. like Oxyd and Syndicate show that very good looking 16-colour games can be
  712. made. 
  713.  
  714. How would this work? For the byte XXXX0000, for instance, you'd make 16 of
  715. your CLUT entries (00000000, 00010000, 00100000, etc.) the same colour and
  716. so on for the 16 possible low nybble values. For the byte 0000XXXX you'd do
  717. the converse. To "flip" the pages you'd change the CLUT.
  718.  
  719. Would the fact that you could save the blit to the screen outweigh the overhead
  720. of using half-bytes and changing the CLUT? Anyone have any best guesses on
  721. this?
  722.  
  723. Sean
  724.  
  725. +++++++++++++++++++++++++++
  726.  
  727. >From Hiep Dam <starlabs@delphi.com>
  728. Date: Fri, 2 Sep 94 00:39:54 -0500
  729. Organization: Delphi (info@delphi.com email, 800-695-4005 voice)
  730.  
  731. <seanmcd@ac.dal.ca> writes:
  732.  
  733. >Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  734. >would involve using 16 colours in a 256 colour palette. The top and bottom
  735. >nybbles of the byte would hold the values for "page 1" and "page 2". Games
  736. >like Oxyd and Syndicate show that very good looking 16-colour games can be
  737. >made. 
  738.  
  739. I believe (though I can't be sure) that Arashi does this. Actually I'm
  740. pretty sure. For those not familiar with Arashi, it's basically a clone
  741. to that cool Atari game of years past, Tempest. I think Arashi uses 2
  742. 16 color "planes" within a 256 color palette, and does simulate page
  743. flipping with this.
  744.  
  745. You can find the source code to Arashi, along with the "Vector kit", at
  746. all the popular sites you find source code at. It's was originally written
  747. by the Jurri Munkki, with additional help from team members of Project
  748. Storm.
  749.  
  750. Note however that Arashi's method isn't fullproof. While it works fine
  751. on my IIsi, I get some errant "writes" to the screen on my PowerBook Duo
  752. 230 (when docked, of course).
  753.  
  754. Hiep
  755. starlabs@aol.com += starlabs@delphi.com
  756. "If we are to be labeled, I would have preferred 'Might Morphin Generation X'"
  757.  
  758. +++++++++++++++++++++++++++
  759.  
  760. >From Hugh.Fisher@anu.edu.au (Hugh Fisher)
  761. Date: Fri, 02 Sep 1994 13:46:24 +1000
  762. Organization: BAMBI, Australian National University
  763.  
  764. In article <1994Sep1.211511.27056@ac.dal.ca>, seanmcd@ac.dal.ca wrote:
  765.  
  766. > Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  767. > would involve using 16 colours in a 256 colour palette. The top and bottom
  768. > nybbles of the byte would hold the values for "page 1" and "page 2". Games
  769. > like Oxyd and Syndicate show that very good looking 16-colour games can be
  770. > made. 
  771. > How would this work? For the byte XXXX0000, for instance, you'd make 16 of
  772. > your CLUT entries (00000000, 00010000, 00100000, etc.) the same colour and
  773. > so on for the 16 possible low nybble values. For the byte 0000XXXX you'd do
  774. > the converse. To "flip" the pages you'd change the CLUT.
  775. > Would the fact that you could save the blit to the screen outweigh the overhead
  776. > of using half-bytes and changing the CLUT? Anyone have any best guesses on
  777. > this?
  778.  
  779.   I've played around with this a bit, and found two problems.
  780.  
  781.   The minor one is that if you use the Palette Manager, changing the CLUT
  782.   is *slower* than blitting to the screen. I imagine this is because of the
  783.   need to scan and update the other palettes, because it seems to depend on
  784.   on the mix of other applications open at the time.
  785.  
  786.   You can get around this by using the lower level device calls instead,
  787.   which would be real unsociable for a regular application but acceptable
  788. for 
  789.   a game I guess.
  790.  
  791.   The major one is that drawing to the screen becomes a real pain, because
  792.   you can't touch the high/low 4 bits in each pixel. You have to use
  793. logical
  794.   AND mode (or OR if you know where you are drawing is clear) and use pixel
  795.   values with the high/low bits all set. For bitmapped images, this means
  796.   keeping two copies of each.
  797.  
  798.   Of course, you could try writing your own graphic primitives...but as the
  799.   FAQ for this group explains in detail, this is a Really Bad Idea.
  800.  
  801.   My "guess" therefore is that it is a worthwhile technique if you're
  802. prepared
  803.   to put a lot of time and effort into it (maybe someone already has?) but
  804.   not if you want a quick, easy, and portable solution.
  805.  
  806.         Hugh Fisher
  807.         Biochemistry and Molecular Biology, Australian National University
  808.  
  809. +++++++++++++++++++++++++++
  810.  
  811. >From keyesea@ctrvax.vanderbilt.edu (Edward Keyes)
  812. Date: Sun, 4 Sep 1994 21:47:10 GMT
  813. Organization: Vanderbilt University
  814.  
  815. In article <B+ySeM6.starlabs@delphi.com>,
  816. Hiep Dam <starlabs@delphi.com> wrote:
  817.  
  818. > <seanmcd@ac.dal.ca> writes:
  819. >  
  820. > >Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  821. > >would involve using 16 colours in a 256 colour palette. The top and bottom
  822. > >nybbles of the byte would hold the values for "page 1" and "page 2". Games
  823. > >like Oxyd and Syndicate show that very good looking 16-colour games can be
  824. > >made. 
  825. >  
  826. > I believe (though I can't be sure) that Arashi does this. Actually I'm
  827. > pretty sure. For those not familiar with Arashi, it's basically a clone
  828. > to that cool Atari game of years past, Tempest. I think Arashi uses 2
  829. > 16 color "planes" within a 256 color palette, and does simulate page
  830. > flipping with this.
  831.  
  832. I have always thought that this method would be just superb in combination
  833. with a pair of LCD shutter glasses for a 3D effect.  Just put the left eye
  834. view in the top nybble and the right eye view in the bottom and install an
  835. interrupt routine that animates the palette in synchronization with the
  836. monitor's refresh rate while simultaneously sending the appropriate signal
  837. across a serial or ADB port to the glasses to flip the shutters.
  838.  
  839. And presto!  30+ fps true stereoscopic graphics with a lot less processor
  840. overhead than having to individually blit the left and right eye views
  841. over and over again.
  842.  
  843. Has anyone had any luck with adopting a set of those old Sega 3D glasses
  844. to the Mac for this sort of thing?
  845.  
  846. - ------  Edward Keyes (keyesea@ctrvax.vanderbilt.edu)  --------
  847. --  "This is what the LORD Almighty, the God of Israel says:  --
  848. --  'Drink, get drunk and vomit, and fall to rise no more.'"  --
  849. - --------------------------------  Jeremiah 25:27  ------------
  850.  
  851. +++++++++++++++++++++++++++
  852.  
  853. >From amanda@intercon.com (Amanda Walker)
  854. Date: Tue,  6 Sep 1994 14:55:43 -0400
  855. Organization: InterCon Systems Corporation, Herndon, VA  USA
  856.  
  857. Hiep Dam <starlabs@delphi.com> writes:
  858. > I believe (though I can't be sure) that Arashi does this. Actually 
  859. > I'm pretty sure. For those not familiar with Arashi, it's basically 
  860. > a clone to that cool Atari game of years past, Tempest. I think 
  861. > Arashi uses 2 16 color "planes" within a 256 color palette, and 
  862. > does simulate page flipping with this. 
  863.  
  864. Actually, Arashi uses two 3-bit (8 color) planes, and one 2-bit background 
  865. plane.  It also has the smoothest code for doing this sort of stuff on the Mac 
  866. that I've yet seen in the public domain.
  867.  
  868.  
  869. Amanda Walker
  870. InterCon Systems Corporation
  871.  
  872.  
  873.  
  874. +++++++++++++++++++++++++++
  875.  
  876. >From temple@itd.nrl.navy.mil (Dr. Jon Gerard Temple)
  877. Date: 6 Sep 1994 20:02:49 GMT
  878. Organization: Naval Research Laboratory
  879.  
  880. In article <9409061455.AA43720@fusion.intercon.com>
  881. amanda@intercon.com (Amanda Walker) writes:
  882.  
  883. > Hiep Dam <starlabs@delphi.com> writes:
  884. > > I believe (though I can't be sure) that Arashi does this. Actually 
  885. > > I'm pretty sure. For those not familiar with Arashi, it's basically 
  886. > > a clone to that cool Atari game of years past, Tempest. I think 
  887. > > Arashi uses 2 16 color "planes" within a 256 color palette, and 
  888. > > does simulate page flipping with this. 
  889. > Actually, Arashi uses two 3-bit (8 color) planes, and one 2-bit background 
  890. > plane.  It also has the smoothest code for doing this sort of stuff on the Mac 
  891. > that I've yet seen in the public domain.
  892.  
  893. It runs pretty smoothly, too.  I don't understand why people over at
  894. comp.sys.mac.games think it is a weak Tempest clone.  It is one of the
  895. best clones I have ever seen, and it is free, as well as a little more
  896. colorful than the original. I actually sent Juri Munkki a "fan" letter
  897. after seeing an early beta (called "STORM" then).  Tempest was one of
  898. the few games I really missed from my teen years...
  899.  
  900. +++++++++++++++++++++++++++
  901.  
  902. >From Darrin Cardani <Darrin.Cardani@AtlantaGA.NCR.COM>
  903. Date: Wed, 7 Sep 1994 17:10:59 GMT
  904. Organization: AT&T Global Information Solutions, Atlanta
  905.  
  906. >In article <34iht9$q1s@ra.nrl.navy.mil> Dr. Jon Gerard Temple writes: 
  907. [...stuff about Arashi...]
  908. >It runs pretty smoothly, too.  I don't understand why people over at
  909. >comp.sys.mac.games think it is a weak Tempest clone.  It is one of the
  910. >best clones I have ever seen, and it is free, as well as a little more
  911. >colorful than the original. I actually sent Juri Munkki a "fan" letter
  912. >after seeing an early beta (called "STORM" then).  Tempest was one of
  913. >the few games I really missed from my teen years...>
  914.  
  915. Geez! If they think Arashi is weak, they should see the
  916. piece of crap version I have on my Windows machine at
  917. work. It blinks really bad, firing doesn't work correctly.
  918. Oh well.
  919.  
  920. Darrin
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. +++++++++++++++++++++++++++
  929.  
  930. >From jbum@netcom.com (Jim Bumgardner)
  931. Date: Wed, 7 Sep 1994 19:33:55 GMT
  932. Organization: Time Warner Interactive Group
  933.  
  934. seanmcd@ac.dal.ca wrote:
  935. : Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  936. : would involve using 16 colours in a 256 colour palette. The top and bottom
  937. : nybbles of the byte would hold the values for "page 1" and "page 2". Games
  938. : like Oxyd and Syndicate show that very good looking 16-colour games can be
  939. : made. 
  940.  
  941. I wrote some sample code that uses an extension of this idea to do
  942. cross fades (cross dissolves) some months ago for a book
  943. I was working on.  I've made the code available by ftp from ftp.netcom.com
  944. in the directory pub/jbum.  The file is called CrossDissolveExample.sit
  945.  
  946. Although changing the CLUT is slower than blitting to the screen, it
  947. does allow for an extremely smooth crossfade effect which is especially
  948. effective for displaying movie credits.  The program "Credits" included
  949. with the archive demonstrates this.
  950.  
  951.  
  952. -- 
  953. --
  954. -- Jim Bumgardner                 |   jbum@netcom.com
  955. -- Time Warner Interactive
  956. -- GSC/MUd--p(-)c+++!lu+e-m*s/+n++(---)h--f!gw+t+ry++
  957.  
  958. ---------------------------
  959.  
  960. >From partingt@fwi.uva.nl (Vincent Partington)
  961. Subject: Why is AppleScript type checking absent?
  962. Date: 6 Sep 1994 08:37:27 GMT
  963. Organization: FWI, University of Amsterdam
  964.  
  965. Hi,
  966.  
  967. Why is that the AppleScript Script Editor doesn't warn me about passing the
  968. wrong type of data to requests while the 'aete' resource tells it what sort
  969. of data to expect?
  970.  
  971. The following line will compile just fine:
  972. open {file "hard disk:hello.c"}
  973. Although it should be:
  974. open {alias "hard disk:hello.c"}
  975.  
  976. Most of the time the first line will work because most handlers ask the AEM
  977. to coerce the argument into an FSSpec. But it's still wrong.
  978.  
  979. The following will also compile:
  980. open {"hard disk:hello.c"}
  981.  
  982. That won't work of course, but why won't AppleScript tell me about it?
  983. Why can't is see the open-event wants a list of aliases and either tell me
  984. it's wrong or (even better) convert it into an alias for me?
  985.  
  986. Thanks, Vincent.
  987. -- 
  988. appel peer banaan baksteen           ||| The Fingerware Project:
  989. schelp zon zand rolstoel             ||| Put your code snippets in your .plan!
  990. groen wit geel flatgebouw            ||| If you want to know more
  991. boer postbode bouwvakker roos        ||| finger partingt@gene.fwi.uva.nl
  992.  
  993. +++++++++++++++++++++++++++
  994.  
  995. >From urge@mcl.ucsb.edu (Scott Bronson)
  996. Date: 6 Sep 1994 19:33:45 GMT
  997. Organization: University of California, Santa Barbara
  998.  
  999. In <34h9o7$t3o@hermes.fwi.uva.nl> partingt@fwi.uva.nl (Vincent Partington) writes:
  1000.  
  1001. >open {file "hard disk:hello.c"} vs. open {alias "hard disk:hello.c"}
  1002. >Most of the time the first line will work because most handlers ask the AEM
  1003. >to coerce the argument into an FSSpec. But it's still wrong.
  1004.  
  1005. No, it's correct.  The AppleScript Language Guide, p. 81, tells how
  1006. automatic coercion works.
  1007.  
  1008.  
  1009. >The following will also compile:
  1010. >open {"hard disk:hello.c"}
  1011.  
  1012. >That won't work of course, but why won't AppleScript tell me about it?
  1013. >Why can't is see the open-event wants a list of aliases and either tell me
  1014. >it's wrong or (even better) convert it into an alias for me?
  1015.  
  1016. Actually, sometimes it works.  This very script just executed perfectly
  1017. not two minutes ago...
  1018.  
  1019. tell application "Scriptable Text Editor"
  1020.         open {"Dev.CD Sep 93:Reference Library:Periodicals:develop:develop Issue 15:develop 15 code:Floaters:Source:floaters.make"}
  1021. end tell
  1022.  
  1023. My guess is that coercion from a string to an alias is automatic, although
  1024. the Language Guide does not make this obvious.  If an application's
  1025. dictionary is set up differently than the Scriptable Text Editor's,
  1026. your mileage may vary.
  1027.  
  1028. The reason the following is not flagged at compile time...
  1029.  
  1030. tell application "Scriptable Text Editor"
  1031.         open {1}
  1032. end tell
  1033.  
  1034. ...is because the open routine asks for a list, and that is exactly
  1035. what you are passing.  AppleScript doesn't worry about the contents
  1036. of the list, because they may change or be able to be coerced at run
  1037. time.
  1038.  
  1039. These are all just guesses, but I think I'm close...
  1040.  
  1041.     - Scott
  1042.  
  1043. +++++++++++++++++++++++++++
  1044.  
  1045. >From qsi@cnh.wlink.nl (Peter Kocourek)
  1046. Date: 07 Sep 94 18:15:17 +
  1047. Organization: Care Net Holland
  1048.  
  1049. Vincent Partington wrote on 06 Sep 94:
  1050.  
  1051.  VP> Why is that the AppleScript Script Editor doesn't warn me about 
  1052.  VP> passing the wrong type of data to requests while the 'aete' 
  1053.  VP> resource tells it what sort of data to expect? 
  1054.  
  1055. [snip]
  1056.  
  1057.  VP> The following will also compile: open {"hard disk:hello.c"} 
  1058.  VP> 
  1059.  VP> That won't work of course, but why won't AppleScript tell me 
  1060.  VP> about it? Why can't is see the open-event wants a list of aliases 
  1061.  VP> and either tell me it's wrong or (even better) convert it into 
  1062.  VP> an alias for me? 
  1063.  
  1064. I think it's probably related to coercion handlers; the Script Editor cannot
  1065. know which coercion handlers will be present at runtime, because applications
  1066. can install their own. So while there is no built-in handler for coercing
  1067. typeFSS to typeAlias, there could be one present by the time the application
  1068. is run.
  1069.  
  1070. So you're left with run-time type checking. I'm not particularly happy about
  1071. it myself, but I don't see any other alternative. Perhaps adding coercion
  1072. information in a resource? Then the Script Editor could take the built-in
  1073. coercions for granted, and add to that the coercion handlers the application
  1074. promises to install if it is run.
  1075.  
  1076.  
  1077. YHS:QSI!
  1078. ;Simple help instructions for fileserv via a GIGO gateway..
  1079. ; ASCII               Forces ASCII dump (ie text,etc)
  1080. ; BINARY              Forces UUENCODED binary files (autosplit)
  1081. ; DETECT              Autodetects ASCII/BINARY
  1082. ; GET filename.ext    gets a single file
  1083. ; GET filename.      gets anything starting with filename.
  1084. ; HELP                this help file
  1085. ; INDEX               Asks for the host's list of public files
  1086. ; SIZE xxx            Size per split (1500-45000)
  1087. ;Note on filenames: DOS wildcards are accepted, but not unix regex.
  1088. ;
  1089. ;
  1090. ;Questions? Email root@cnh.wlink.nl ..
  1091.  
  1092. +++++++++++++++++++++++++++
  1093.  
  1094. >From jwbaxter@olympus.net (John W. Baxter)
  1095. Date: Wed, 07 Sep 1994 17:56:10 -0700
  1096. Organization: Internet for the Olympic Peninsula
  1097.  
  1098. I believe it was in this thread earlier that I noticed a statement that a
  1099. path ("Vol:Folder:file") could be used...this is an artifact of (at least)
  1100. the Jon's Commands Scripting Addition, which installs a coercion osax
  1101. which converts from (suitable) TEXT to 'fss '.  Remove Jon's Commands (or
  1102. whatever other osax is installing the handler) and restart, and the
  1103. ability will go away (unless the target app itself installs a TEXT->fss 
  1104. handler).
  1105.  
  1106. Simple, eh?  No wonder there's no type checking.  --John
  1107.  
  1108. -- 
  1109. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1110.    "Occasionally...astronomers add a second to either June 31 or
  1111.     December 31..."   IM: OS Utilities, p 4-12
  1112.    jwbaxter@pt.olympus.net
  1113.  
  1114. +++++++++++++++++++++++++++
  1115.  
  1116. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  1117. Date: Thu, 8 Sep 1994 01:37:46 GMT
  1118. Organization: Apple Computer
  1119.  
  1120. Vincent Partington, partingt@fwi.uva.nl writes:
  1121. > Why is that the AppleScript Script Editor doesn't warn me about passing the
  1122. > wrong type of data to requests while the 'aete' resource tells it what sort
  1123. > of data to expect?
  1124.  
  1125. The data types in the 'aete' are just guidelines or documentation. There are
  1126. plenty of cases where several types can be passed to a parameter, and the
  1127. 'aete' doesn't indicate that. For that reason and others, AppleScript does
  1128. not use that information when compiling a script. It's a dynamic language
  1129. (like Smalltalk or Dylan) that does not do type checking at compile time;
  1130. this does let you make mistakes in your scripts, but it also allows you a lot
  1131. more flexibility.
  1132.  
  1133. --Jens Alfke                           jens_alfke@powertalk.apple.com
  1134.                    "A man, a plan, a yam, a can of Spam ... Bananama!"
  1135.  
  1136. ---------------------------
  1137.  
  1138. >From chris-b@cs.auckland.ac.nz (Chris Burns)
  1139. Subject: [Q] _PBCatSearch vs Recursive Indexed _PBGetCatInfo
  1140. Date: Mon, 05 Sep 1994 09:01:48 +1200
  1141. Organization: AucklandUniversity:ComputerScience:HMU
  1142.  
  1143. Hi all,
  1144.  
  1145. I'm just about to start working on a spare-time project that involves
  1146. scanning disk directories.
  1147.  
  1148. Now, there seem to be (at least) two ways fo doing this:
  1149.  
  1150. (1) _PBCatSearch (if supported)
  1151.  
  1152. (2) Indexed calls to _PBGetCatInfo, recursing when a directory is found. I'd
  1153.     probably use the modification to this algorithm suggested by John Norstad
  1154.     (this takes multiple processes creating, moving and deleting files and
  1155.     directories into account).
  1156.  
  1157. I've implemented (2) before and it was not particularly speedy on my 1GB
  1158. hard disk at work (~10,000 files!). Does anyone know if (1) is any faster?
  1159. I realize the search parameters probably make a huge difference on the
  1160. speed (partial filenames etc), but I'd probably use a "find-all" parameter
  1161. set.
  1162.  
  1163. Any help, flames or pointers appreciated,
  1164.  
  1165. Thanks In Advance,
  1166.  
  1167. Chris B
  1168. - ---------------------------------------------------------------------
  1169. NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
  1170. Internet: chris-b@cs.auckland.ac.nz
  1171. Phone:    +64 9 373-7599 x6194
  1172. Fax:      +64 9 373-7453                         Async, therefore I am.
  1173. - ---------------------------------------------------------------------
  1174.  
  1175. +++++++++++++++++++++++++++
  1176.  
  1177. >From jumplong@aol.com (Jump Long)
  1178. Date: 5 Sep 1994 02:27:10 -0400
  1179. Organization: America Online, Inc. (1-800-827-6364)
  1180.  
  1181. In article <chris-b-0509940901480001@hmu7.cs.aukuni.ac.nz>,
  1182. chris-b@cs.auckland.ac.nz (Chris Burns) writes:
  1183.  
  1184. >I've implemented (2) before and it was not particularly speedy on my 1GB
  1185. >hard disk at work (~10,000 files!). Does anyone know if (1) is any
  1186. faster?
  1187. >I realize the search parameters probably make a huge difference on the
  1188. >speed (partial filenames etc), but I'd probably use a "find-all"
  1189. parameter
  1190. >set.
  1191.  
  1192. In general, PBCatSearch is faster. The only condition I've seen where
  1193. PBCatSearch is slower is if you are looking for *all* matches (i.e., all
  1194. files and directories) on an AppleShare volume.  The AppleShare client
  1195. asks for the CatSearch matches four at a time which doesn't shove the
  1196. information across the network as efficiently as indexed GetCatInfo calls
  1197. which are translated into afpEnumerate requests (which collect as many
  1198. directory entries as will fit into a full sized ATP response).  If you're
  1199. expecting just a few matches to specific criteria, however, PBCatSearch is
  1200. faster because all of the searching is done on the server and only the
  1201. matches are returned over the network.
  1202.  
  1203. >Any help, flames or pointers appreciated,
  1204.  
  1205. A couple of suggestions:
  1206.  
  1207. First, read the Technical Note "FL 31 - Searching Volumes-Solutions and
  1208. Problems". When I updated it a couple of years ago, I tried to cover much
  1209. of what you're asking.
  1210.  
  1211. Second, get MoreFiles v1.2.1.  I added an indexed search routine
  1212. (IndexedSearch) that is parameter block compatible and functionally
  1213. compatible with PBCatSearch except that you get to specify the directory
  1214. you want to search (for example, to search the whole volume, you just pass
  1215. fsRtDirID). I also added a glue routine (PBCatSearchSyncCompat) that calls
  1216. PBCatSearch if PBCatSearch is available and calls IndexedSearch if it's
  1217. not. MoreFiles can be found at:
  1218.  
  1219.     ftp.apple.com (IP address 130.43.2.3)
  1220.  
  1221.     /ftp/dts/mac/sc/more-files-1-2-1.hqx
  1222.  
  1223. - Jim Luther
  1224.  
  1225.  
  1226. +++++++++++++++++++++++++++
  1227.  
  1228. >From chris-b@cs.auckland.ac.nz (Chris Burns)
  1229. Date: Mon, 05 Sep 1994 19:17:00 +1200
  1230. Organization: AucklandUniversity:ComputerScience:HMU
  1231.  
  1232. In article <chris-b-0509940901480001@hmu7.cs.aukuni.ac.nz>,
  1233. chris-b@cs.auckland.ac.nz wrote:
  1234.  
  1235. > Hi all,
  1236. > I'm just about to start working on a spare-time project that involves
  1237. > scanning disk directories.
  1238.  
  1239. Well, since nobody had replied to my post for at least 2 hours :)
  1240. I wrote a quick test app.
  1241.  
  1242. Results:
  1243.  
  1244. Power Mac 8100/80, 1GB HD with 9,461 items (557.8 MB in disk)
  1245.  
  1246. _PBGetCatInfo:      ~1450 Ticks
  1247. _PBCatSearch:       ~65 Ticks
  1248.  
  1249. Wow!
  1250.  
  1251. I compiled the app with CodeWarrior CW4 and both PPC and 68K versions
  1252. performed similarly as expected (program involveds much heavy file I/O).
  1253.  
  1254. I'd be interested to see any other results...
  1255.  
  1256. Later,
  1257.  
  1258. Chris B
  1259.  
  1260. Code Follows...
  1261.  
  1262.  
  1263. ///////////////////////////////////////////////////////////////////////////////
  1264.  
  1265. void Prime_PBGetCatInfo (void);
  1266. void Enumerate_PBGetCatInfo (long CurDirID);
  1267. void Prime_PBCatSearch (void);
  1268. void Enumerate_PBCatSearch (void);
  1269.  
  1270. ///////////////////////////////////////////////////////////////////////////////
  1271.  
  1272. CInfoPBRec      gCInfoPB1;
  1273. Str255          gName;
  1274.  
  1275. ///////////////////////////////////////////////////////////////////////////////
  1276.  
  1277. void Prime_PBGetCatInfo (void)
  1278. {
  1279.     gCInfoPB1.dirInfo.ioNamePtr = gName;
  1280.     gCInfoPB1.dirInfo.ioVRefNum = -1;
  1281. }
  1282.  
  1283. ///////////////////////////////////////////////////////////////////////////////
  1284.  
  1285. void Enumerate_PBGetCatInfo (long CurDirID)
  1286. {
  1287. short   CurDirIndex = 0;
  1288. OSErr   Err;
  1289.  
  1290.     do
  1291.     {
  1292.         CurDirIndex++;
  1293.  
  1294.         gName[0] = 0;
  1295.  
  1296.         gCInfoPB1.dirInfo.ioFDirIndex = CurDirIndex;
  1297.         gCInfoPB1.dirInfo.ioDrDirID = CurDirID;
  1298.  
  1299.         Err = PBGetCatInfoSync(&gCInfoPB1);
  1300.  
  1301.         switch (Err)
  1302.         {
  1303.             case noErr:             
  1304.                 if (gCInfoPB1.dirInfo.ioFlAttrib & 16)
  1305.                     Enumerate_PBGetCatInfo(gCInfoPB1.dirInfo.ioDrDirID);
  1306.                 break;
  1307.  
  1308.             case fnfErr:
  1309.                 break;
  1310.  
  1311.             default:
  1312.                 DebugStr("\p_PBGetCatInfoSync FAILED");
  1313.                 break;
  1314.         }
  1315.     }
  1316.     while (Err == noErr);
  1317. }
  1318.  
  1319. ///////////////////////////////////////////////////////////////////////////////
  1320.  
  1321. CSParam         gCSParamPB;
  1322. CInfoPBRec      gCInfoPB2;
  1323.  
  1324. ///////////////////////////////////////////////////////////////////////////////
  1325.  
  1326. void Prime_PBCatSearch (void)
  1327. {
  1328.  
  1329.     gCSParamPB.ioNamePtr = nil;
  1330.     gCSParamPB.ioVRefNum = -1;
  1331.  
  1332.     gCSParamPB.ioMatchPtr = (FSSpecPtr)NewPtr(sizeof(FSSpec) * 1000);
  1333.     if ((gCSParamPB.ioMatchPtr == nil) || (MemError() != noErr))
  1334.         DebugStr("\p_NewPtr FAILED");
  1335.  
  1336.     gCSParamPB.ioReqMatchCount = 1000;
  1337.  
  1338.     gCSParamPB.ioSearchBits = 0;
  1339.  
  1340.     gCSParamPB.ioSearchInfo1 = (CInfoPBPtr)&gCInfoPB1;
  1341.     gCSParamPB.ioSearchInfo2 = (CInfoPBPtr)&gCInfoPB2;
  1342.  
  1343.     gCSParamPB.ioSearchTime = 0;
  1344.  
  1345.     gCSParamPB.ioCatPosition.initialize = 0;
  1346.  
  1347.     gCSParamPB.ioOptBuffer = NewPtr(16 * 1024L);
  1348.     if ((gCSParamPB.ioOptBuffer == nil) || (MemError() != noErr))
  1349.         DebugStr("\p_NewPtr FAILED");
  1350.  
  1351.     gCSParamPB.ioOptBufSize = 16 * 1024L;
  1352. }
  1353.  
  1354. ///////////////////////////////////////////////////////////////////////////////
  1355.  
  1356. void Enumerate_PBCatSearch (void)
  1357. {
  1358. OSErr   Err;
  1359.  
  1360.     do
  1361.     {
  1362.         Err = PBCatSearchSync(&gCSParamPB);
  1363.         switch (Err)
  1364.         {
  1365.             case noErr:
  1366.                 break;
  1367.  
  1368.             case eofErr:
  1369.                 break;
  1370.  
  1371.             default:
  1372.                 DebugStr("\p_PBCatSearchSync FAILED");
  1373.                 break;
  1374.         }
  1375.     }
  1376.     while (Err == noErr);
  1377. }
  1378.  
  1379. ///////////////////////////////////////////////////////////////////////////////
  1380.  
  1381. void main (void)
  1382. {
  1383. long    StartTicks;
  1384. Str255  Str1;
  1385. Str255  Str2;
  1386.  
  1387.     InitGraf(&qd.thePort);
  1388.  
  1389.     Prime_PBGetCatInfo();
  1390.     StartTicks = TickCount();
  1391.     Enumerate_PBGetCatInfo(fsRtDirID);
  1392.     NumToString(TickCount() - StartTicks,Str1);
  1393.  
  1394.     Prime_PBCatSearch();
  1395.     StartTicks = TickCount();
  1396.     Enumerate_PBCatSearch();
  1397.     NumToString(TickCount() - StartTicks,Str2);
  1398.  
  1399.     SysBeep(0);
  1400.     DebugStr(Str1);
  1401.     DebugStr(Str2);
  1402. }
  1403.  
  1404. ///////////////////////////////////////////////////////////////////////////////
  1405. - ---------------------------------------------------------------------
  1406. NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
  1407. Internet: chris-b@cs.auckland.ac.nz
  1408. Phone:    +64 9 373-7599 x6194
  1409. Fax:      +64 9 373-7453                         Async, therefore I am.
  1410. - ---------------------------------------------------------------------
  1411.  
  1412. +++++++++++++++++++++++++++
  1413.  
  1414. >From h+@nada.kth.se (Jon W{tte)
  1415. Date: Mon, 05 Sep 1994 17:34:17 +0200
  1416. Organization: Royal Institute of Something or other
  1417.  
  1418. In article <chris-b-0509940901480001@hmu7.cs.aukuni.ac.nz>,
  1419. chris-b@cs.auckland.ac.nz (Chris Burns) wrote:
  1420.  
  1421. >I've implemented (2) before and it was not particularly speedy on my 1GB
  1422. >hard disk at work (~10,000 files!). Does anyone know if (1) is any faster?
  1423.  
  1424. PBCatSearch linearly searches the directory tree; and can be 
  1425. fast for things like name searches, but it's practically 
  1426. worthless if you want to know about file hiearchies.
  1427.  
  1428. PBGetCatInfo isn't too bad, especially if you read all the 
  1429. files FIRST, remembering which folders there were and going 
  1430. back to them after doing the scan (this is because there is 
  1431. some "next pointer" cache in the file system, it seems)
  1432.  
  1433. You should also remember how many files there are in the 
  1434. folder, and only iterate for that many if you want speed; the 
  1435. "miss" giving eofErr at the end can take magnitudes longer time 
  1436. than a "hit" for an indexed search!
  1437.  
  1438. Cheers,
  1439.  
  1440.                 / h+
  1441.  
  1442.  
  1443. --
  1444.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  1445.    This signature is kept shorter than 4 lines in the interests of UseNet
  1446.    S/N ratio.
  1447.  
  1448.  
  1449. +++++++++++++++++++++++++++
  1450.  
  1451. >From chris-b@cs.auckland.ac.nz (Chris Burns)
  1452. Date: Tue, 06 Sep 1994 10:13:49 +1200
  1453. Organization: AucklandUniversity:ComputerScience:HMU
  1454.  
  1455. In article <chris-b-0509941917000001@hmu7.cs.aukuni.ac.nz>,
  1456. chris-b@cs.auckland.ac.nz wrote:
  1457.  
  1458. > In article <chris-b-0509940901480001@hmu7.cs.aukuni.ac.nz>,
  1459. > chris-b@cs.auckland.ac.nz wrote:
  1460. > > Hi all,
  1461. > > 
  1462. > > I'm just about to start working on a spare-time project that involves
  1463. > > scanning disk directories.
  1464. > Results:
  1465. > Power Mac 8100/80, 1GB HD with 9,461 items (557.8 MB in disk)
  1466. > _PBGetCatInfo:      ~1450 Ticks
  1467. > _PBCatSearch:       ~65 Ticks
  1468.  
  1469. Well, it gets more interesting...
  1470.  
  1471. FileSharing:                    On  |    Off
  1472. - ----------------------------------+--------
  1473. PPC App:  _PBGetCatInfo:     ~5050  |  ~1450
  1474.           _PBCatSearch:        ~65  |    ~65
  1475.                                     |
  1476. 68K App:  _PBGetCatInfo:     ~5030  |  ~1480
  1477.           _PBCatSearch:        ~65  |    ~65
  1478.  
  1479. Seems like FileSharing causes a big hit on _PBGetCatInfo!
  1480.  
  1481. Later,
  1482.  
  1483. Chris B
  1484. - ---------------------------------------------------------------------
  1485. NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
  1486. Internet: chris-b@cs.auckland.ac.nz
  1487. Phone:    +64 9 373-7599 x6194
  1488. Fax:      +64 9 373-7453                         Async, therefore I am.
  1489. - ---------------------------------------------------------------------
  1490.  
  1491. +++++++++++++++++++++++++++
  1492.  
  1493. >From chris-b@cs.auckland.ac.nz (Chris Burns)
  1494. Date: Tue, 06 Sep 1994 13:28:28 +1200
  1495. Organization: AucklandUniversity:ComputerScience:HMU
  1496.  
  1497. In article <34ednu$i8s@search01.news.aol.com>, jumplong@aol.com (Jump
  1498. Long) wrote:
  1499.  
  1500. > In general, PBCatSearch is faster. The only condition I've seen where
  1501. > PBCatSearch is slower is if you are looking for *all* matches (i.e., all
  1502. > files and directories) on an AppleShare volume.  The AppleShare client
  1503. > asks for the CatSearch matches four at a time which doesn't shove the
  1504. > information across the network as efficiently as indexed GetCatInfo calls
  1505. > which are translated into afpEnumerate requests (which collect as many
  1506. > directory entries as will fit into a full sized ATP response).  If you're
  1507. > expecting just a few matches to specific criteria, however, PBCatSearch is
  1508. > faster because all of the searching is done on the server and only the
  1509. > matches are returned over the network.
  1510.  
  1511. I tried this, and Jim is correct.
  1512.  
  1513. PPC App:  _PBGetCatInfo:     ~4820 Ticks
  1514.           _PBCatSearch:      ~5155 Ticks
  1515.  
  1516. Thanks Jim!
  1517.  
  1518. Chris B
  1519. - ---------------------------------------------------------------------
  1520. NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
  1521. Internet: chris-b@cs.auckland.ac.nz
  1522. Phone:    +64 9 373-7599 x6194
  1523. Fax:      +64 9 373-7453                         Async, therefore I am.
  1524. - ---------------------------------------------------------------------
  1525.  
  1526. +++++++++++++++++++++++++++
  1527.  
  1528. >From jumplong@aol.com (Jump Long)
  1529. Date: 6 Sep 1994 00:07:06 -0400
  1530. Organization: America Online, Inc. (1-800-827-6364)
  1531.  
  1532. In article <9668AA910719.386758@klkmac014.nada.kth.se>, h+@nada.kth.se
  1533. (Jon W{tte) writes:
  1534.  
  1535. >You should also remember how many files there are in the 
  1536. >folder, and only iterate for that many if you want speed; the 
  1537. >"miss" giving eofErr at the end can take magnitudes longer time 
  1538. >than a "hit" for an indexed search!
  1539.  
  1540. That's not a good idea because the number of items in a directory can
  1541. change - another process or another client using a shared volume could
  1542. delete or add one or more files/directories to the folder you're indexing
  1543. through.  There also could or may be foreign file systems that don't
  1544. return the ioDrNmFls.
  1545.  
  1546. - Jim Luther
  1547.  
  1548. +++++++++++++++++++++++++++
  1549.  
  1550. >From h+@nada.kth.se (Jon W{tte)
  1551. Date: Tue, 06 Sep 1994 11:59:27 +0200
  1552. Organization: Royal Institute of Something or other
  1553.  
  1554. In article <34gpta$82s@search01.news.aol.com>,
  1555. jumplong@aol.com (Jump Long) wrote:
  1556.  
  1557. >>You should also remember how many files there are in the 
  1558. >>folder, and only iterate for that many if you want speed; the 
  1559. >>"miss" giving eofErr at the end can take magnitudes longer time 
  1560. >>than a "hit" for an indexed search!
  1561.  
  1562. >That's not a good idea because the number of items in a directory can
  1563. >change - another process or another client using a shared volume could
  1564.  
  1565. Yes. I should have made it clear that this was a trade-off. You 
  1566. can make sure that you get all files by reading the previous 
  1567. info right after you read the next info, and check that it's 
  1568. "still there". You can get the name of the last file once you 
  1569. get the number of files, and then start over if the file with 
  1570. index <lastIndex> does not have the name <nameOfLastFile>. Etc.
  1571.  
  1572. Cheers,
  1573.  
  1574.                 / h+
  1575.  
  1576.  
  1577. --
  1578.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  1579.  
  1580.   "Have a bearable day."
  1581.  
  1582.  
  1583. +++++++++++++++++++++++++++
  1584.  
  1585. >From alexr@apple.com (Alex Rosenberg)
  1586. Date: Tue, 6 Sep 1994 10:04:30 GMT
  1587. Organization: Hackers Anonymous
  1588.  
  1589. In article <chris-b-0609941013490001@hmu7.cs.aukuni.ac.nz>,
  1590. chris-b@cs.auckland.ac.nz wrote:
  1591.  
  1592. <All sorts of interesting stuff deleted>
  1593. > Seems like FileSharing causes a big hit on _PBGetCatInfo!
  1594.  
  1595. File Sharing adds information to the response from PBGetCatInfo. This
  1596. information is rather complicated to determine. File Sharing makes no
  1597. changes to the response from PBCatSearch.
  1598.  
  1599. - -------------------------------------------------------------------------
  1600. -  Alexander M. Rosenberg  - INTERNET: alexr@apple.com      - Yoyodyne    -
  1601. -  330 Waverley St., Apt B - UUCP:ucbvax!apple!alexr        - Propulsion  -
  1602. -  Palo Alto, CA 94301     -                                - Systems     -
  1603. -  (415) 329-8463          - Nobody is my employer so       - :-)         -
  1604. -  (408) 974-3110          - nobody cares what I say.       -             -
  1605.  
  1606. ---------------------------
  1607.  
  1608. End of C.S.M.P. Digest
  1609. **********************
  1610.  
  1611.  
  1612. ˇ